﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xss.Data.Common;

namespace Xss.Data
{
    public class AdoRegistry
    {
        private static Dictionary<string, IDbSource> dbSource
             = new Dictionary<string, IDbSource>();

        public static void RegisteDbSource(IDbSource value)
        {
            dbSource[value.Name] = value;
        }

        public static IDbSource GetDbSource(string key)
        {

            lock (typeof(IDbSource))
            {
                if (dbSource.ContainsKey(key))
                {
                    return dbSource[key];
                }
            }
            return null;
        }
    }
}
